package org.jeecg.modules.manager.entity;

import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wenhao hu
 * @title: OrderGroupPageVo
 * @projectName biyesheji
 * @description: TODO
 * @date 2022/2/1614:58
 */
@Data
public class OrderGroupPurVo {

    private java.lang.String id;

    private java.lang.String orderName;

    private java.lang.String orderType;

    private java.lang.String createdBy;

    private java.util.Date createdTime;

    private String puroRepoId;

    List<PurchaseOrderAddVo> purchaseOrderAddVos;

    public static OrderGroupPurVo makeVo(OrderGroupPurRo ro){
        OrderGroupPurVo vo = new OrderGroupPurVo();
        BeanUtils.copyProperties(ro,vo);
        List<PurchaseOrderAddVo> vos = new ArrayList<>();
        for (PurchaseOrder r : ro.purchaseOrderAddVos) {
            PurchaseOrderAddVo pVo = new PurchaseOrderAddVo();
            BeanUtils.copyProperties(pVo,r);
            vos.add(pVo);
        }
        vo.setPurchaseOrderAddVos(vos);
        return vo;
    }
}
